<html xmlns="http://www.w3.org/1999/xhtml"  xml:lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<script type="text/javascript" src="../jct.js"></script>
<title>jCT Example,模板简单嵌入html例子 1</title>
<style>
textarea{
overflow-x:scroll;
overflow-y:scroll;
}
</style>
</head>
<body>
<script type="text/javascript">
	function go(){
		document.getElementById('src').value+=go.toString();
		var Instance = new jCT(document.getElementById('template').value);
		Instance.Build();
		document.getElementById('view').innerHTML=Instance.GetView();
	}
</script>
<p>下面是div id=view 用来表现模板执行后的结果<button onclick="go();">执行</button></p>
<div id="view"></div>
<hr style="clear:both;" />
<p>下面是javascript脚本</p>
<textarea id="src" style="width:100%;height:150px;">
/*这个例子中模板的Build,和执行结果的控制都有下面的函数负责,此函数在body onload中被调用*/
</textarea>
<p>下面是模板源码</p>
<textarea id="template" style="width:100%;height:200px;">
	<ul>
	<!---for(var i=65;i<=90;i++){-->
	<li style="float:left;list-style-type:none;" id="id+-i-+">
		<span style="margin:4px;">+-String.fromCharCode(i)-+</span>
	</li>
	<!---}-->
	</ul>
</textarea>
</body>
</html>